/**
 * Created by wuhaiyang on 2017/4/13.
 */


import React, {Component} from 'react'

import {
    StyleSheet,
    View,
    Text,
    Image,
    TouchableOpacity
} from 'react-native'

import NavigationToolbar1 from '../widget/NavigationToolbar1'

export default class ComponentY extends Component {
    constructor(props) {
        super(props)
    }

    sendGoods() {
        this.props.onDataCallback('一瓶酒')
        this.props.navigator.pop()
    }

    renderLeftView() {
        return <TouchableOpacity
            onPress={()=>{
                this.props.navigator.pop()
            }}
            style={{paddingLeft:10}}
        >
            <Image
                style={{height:22,width:22}}
                source={require('../../res/img/ic_arrow_back_white_36pt.png')}></Image>
        </TouchableOpacity>
    }

    render() {
        return (
            <View style={styles.container}>

                <NavigationToolbar1
                    title='我是卖家'
                    leftView={this.renderLeftView()}
                />

                <View style={{flex:1,alignItems:'center',justifyContent:'center'}}>

                    <Text>
                        受到买家的money是：{this.props.money}
                    </Text>

                    <Text
                        onPress={()=>this.sendGoods()}
                    >
                        点击我发货给买家
                    </Text>
                </View>

            </View>
        )
    }
}

const styles = {
    container: {
        flex: 1,
        backgroundColor: 'gray'
    }
}
